package top.shaoxia.pwdm.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import java.time.LocalDateTime;
import java.util.StringJoiner;

/**
 * @author wjc
 * @date 2022/2/19
 */
@Table("PWDM_DETAILS")
public class PwdmDetailsDO {
    @Id
    private Integer id;
    private String title;
    private String username;
    private String pwd;
    private String addr;//地址
    private String memo;//备注
    @Column("FOLDER_ID")
    private Integer folderId;//文件夹id
    private Byte deleted;//1：删除；0：正常
    private Byte star;//1：收藏；0：没收藏
    @Column("UPDATE_TIME")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//不适用于@RequestBody注解接收的数据，@RequestBody接收数据会自动转换，不用处理
    private LocalDateTime updateTime;
    private Integer sn; //排序号

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Integer getFolderId() {
        return folderId;
    }

    public void setFolderId(Integer folderId) {
        this.folderId = folderId;
    }

    public Byte getDeleted() {
        return deleted;
    }

    public void setDeleted(Byte deleted) {
        this.deleted = deleted;
    }

    public Byte getStar() {
        return star;
    }

    public void setStar(Byte star) {
        this.star = star;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getSn() {
        return sn;
    }

    public void setSn(Integer sn) {
        this.sn = sn;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", PwdmDetailsDO.class.getSimpleName() + "[", "]")
                .add("id=" + id)
                .add("title='" + title + "'")
                .add("username='" + username + "'")
                .add("pwd='" + pwd + "'")
                .add("addr='" + addr + "'")
                .add("memo='" + memo + "'")
                .add("folderId=" + folderId)
                .add("deleted=" + deleted)
                .add("star=" + star)
                .add("updateTime=" + updateTime)
                .add("sn=" + sn)
                .toString();
    }
}
